package com.hyts.mvc.servlet;

import com.hyts.guava.array.Arrays;
import com.hyts.mvc.config.MvcValue;
import com.hyts.mvc.configure.WebMvcConfigurerAdapter;
import com.hyts.mvc.configure.WebMvcConfigurerRegistry;
import com.hyts.mvc.register.ServletRegistationWrapper;

import java.util.stream.Collectors;
import java.util.stream.Stream;

import static com.hyts.mvc.config.MvcValue.STATIC_SUBFIX_NAME;

/**
 * project-name:coffice-toolbox
 * package-name:com.hyts.mvc.configure
 * author:Libo/Alex
 * create-date:2019-07-02 22:37
 * email:liboware@gmail.com
 * description:此类主要用于: 用于创建addWebServlet服务操作信息
 * @author alex
 */
public class DefaultWebMvcConfiguration extends WebMvcConfigurerAdapter {


    @Override
    protected void addWebServlet(WebMvcConfigurerRegistry webMvcConfigurerRegistry) {
        ServletRegistationWrapper servletRegistationWrapper = ServletRegistationWrapper.builder().build();
        servletRegistationWrapper.addServlet(MvcValue.MVC_SERVLET_NAME,WebMvcServlet.class,
                0, MvcValue.DEFAULT_VIEW_SERVLET_URL_PATH);
        webMvcConfigurerRegistry.addServletRegistation(servletRegistationWrapper);
    }

    @Override
    protected void addWebFilter(WebMvcConfigurerRegistry webMvcConfigurerRegistry) {

    }

    @Override
    protected void addWebListener(WebMvcConfigurerRegistry webMvcConfigurerRegistry) {

    }

    @Override
    public int value() {
        return 1;
    }

}
